﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LightningChartBindingExample
{
        public class MainViewModel : INotifyPropertyChanged
        {
            public ObservableCollection<SeriesViewModel> SeriesCollection { get; set; }

            public MainViewModel()
            {
                // 初始化多个子 ViewModel，每个子 ViewModel 表示一条数据曲线
                SeriesCollection = new ObservableCollection<SeriesViewModel>
            {
                new SeriesViewModel("Series 1",100),
                new SeriesViewModel("Series 2",200),
                new SeriesViewModel("Series 3",300)
            };
            }

            public event PropertyChangedEventHandler PropertyChanged;
            protected void OnPropertyChanged(string propertyName = null) =>
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
}
